package com.mxx.common.netty.http;

import io.netty.buffer.ByteBuf;
import io.netty.handler.codec.http.HttpResponseStatus;

import java.io.Serializable;


/**
 * @Auther: Mr. Zeng
 * @Date: 2020/8/3 17:24
 * @Description: 暂无描述
 */
abstract
public interface NettyHttpResponseFactory {

    NettyHttpResponse catchThrowable(Throwable throwable);

    NettyHttpResponse catchResponse(Object result);


    NettyHttpResponse newResponse(HttpResponseStatus status, Serializable content);

    NettyHttpResponse newResponse(HttpResponseStatus status, ByteBuf byteBuf);

    NettyHttpResponse newResponse(HttpResponseStatus status);

    NettyHttpResponse newEmpty();

    NettyHttpResponse newResponse(Throwable exception);

    NettyHttpResponse newRedirect(String url);

    NettyHttpResponse withJson(Serializable serializable);

    NettyHttpResponse withJson(String context);

    NettyHttpResponse withImage(ByteBuf byteBuf);

    NettyHttpResponse withHtml(String html);

    NettyHttpResponse ok(Serializable content);

    NettyHttpResponse ok();


}
